<template>
  <div class="member-order-detail" v-if="order">
    <!-- 头部 -->
    <DetailAction :order="order"/>
    <!-- 进度 -->
    <DetailStep :order="order"/>
    <!-- 物流 -->
    <!--    <Suspense>-->
    <!--      <template #default>-->
    <!--        <DetailLogistics v-if="[3,4,5].includes(order.orderState)" :order="order" />-->
    <!--      </template>-->
    <!--      <template #fallback>-->
    <!--        <div class="loading">loading...</div>-->
    <!--      </template>-->
    <!--    </Suspense>-->
    <!-- 信息 -->
    <DetailInfo :order="order"/>
  </div>
</template>
<script setup>
import DetailInfo from '@/views/Member/components/DetailInfo.vue'
import DetailAction from '@/views/Member/components/DetailAction.vue'
import DetailStep from '@/views/Member/components/DetailStep.vue'
import {ref, onMounted} from "vue";
import {useRoute} from "vue-router";
import {getOrderInfo} from "@/apis/order";

const order = ref(null)
const route = useRoute()

const getOrder = async () => {
  const { data } = await getOrderInfo(route.params.id)
  order.value = data
}

onMounted(() => getOrder())

</script>
<style scoped lang="scss">
.member-order-detail {
  background: #fff;
  height: 100%;
}

.loading {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 30px;
  background-color: #f5f5f5;
  margin: 30px 50px 0;
}
</style>